package com.cx.util.wjj;

import com.cx.pojo.wjj.Start2Destination;
import com.cx.util.wjr.GetDistance;

public class AddressUtil {
    public static Start2Destination address2LonLat(Integer pageNum,String startAddress, String routeAddress,String endAddress){
        Start2Destination start2Destination =new Start2Destination();
        String startLonLat = GetDistance.getLonLat(startAddress);
        String routeLonLat = GetDistance.getLonLat(routeAddress);
        String endLonLat = GetDistance.getLonLat(endAddress);
        long distance = GetDistance.getDistance(routeLonLat, endLonLat);
        long leftTime = distance/40000;
        start2Destination.setPageNum(pageNum);
        start2Destination.setStartAddress(startAddress);
        start2Destination.setRouteAddress(routeAddress);
        start2Destination.setEndAddress(endAddress);
        start2Destination.setStartLonLat(startLonLat);
        start2Destination.setRouteLonLat(routeLonLat);
        start2Destination.setEndLonLat(endLonLat);
        start2Destination.setLeftTime(leftTime);

        return start2Destination;
    }
    public static String characters2LonLat(String province,String city, String area ){
        StringBuilder addressBuilder=new StringBuilder();
        addressBuilder.append(province).append(city).append(area);
        String address=addressBuilder.toString();
        String addressLonLat=GetDistance.getLonLat(address);

    return addressLonLat;
    }

}
